Carbon


GetIcon

Header: Icons.h Carbon status: Supported

Gets a handle to an icon resource of type 'ICON'.

Handle GetIcon (
    SInt16 iconID
);
iconID

The resource ID for an icon of resource type 'ICON'. The function searches the current resource chain for the resource. In general, you should specify your icon resources as purgeable.

function result

A handle to the icon with the specified ID or NULL if the function could not find the resource.

DISCUSSION

To draw an icon obtained from this function in a specified rectangle, you can use either the PlotIcon function, or the PlotIconHandle function. The latter function allows you to specify transforms and alignments.

When you are finished using a handle obtained from this function, use the ReleaseResource function to release the memory occupied by the icon resource data.

SPECIAL CONSIDERATIONS

This function may move or purge memory blocks in the application heap. For that reason, your application should not call it at interrupt time.

VERSION NOTES

This function is available in both System 6 and System 7.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)